package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 包投资订单表衍变状态，贷中和贷后都需要维护，以支持我的投资订单列表分页
 */
@AllArgsConstructor
@Getter
public enum PackageInvestOrderEvolutionStatusEnum {

	DEALING((byte) 0, "处理中"),
	INVESTING((byte) 1, "投资中"),
	BACKING((byte) 2, "回款中"),
	BACKING_OVERDUE((byte) 3, "回款逾期"),
	CLOSED((byte) 4, "已关闭"),
	ALL_BACKED((byte) 5, "已结清"),
	;

	private final Byte value;

	private final String desc;

	public static PackageInvestOrderEvolutionStatusEnum getByValue(byte status) {
		for (PackageInvestOrderEvolutionStatusEnum statusEnum : values()) {
			if (statusEnum.value.equals(status)) {
				return statusEnum;
			}
		}
		throw new NoSuchEnumValueException("PackageInvestOrderEvolutionStatusEnum:" + status);
	}
}
